#ifndef CADREPOSTTAB_H
#define CADREPOSTTAB_H

#include <QWidget>
#include <QSqlTableModel>
#include <QSqlRelationalTableModel>

namespace Ui {
class CadrePostTab;
}

class CadrePostTab : public QWidget
{
    Q_OBJECT

public:
    explicit CadrePostTab(QWidget *parent = 0);
    ~CadrePostTab();
    void initPostTableView(QString curPerson);
    void setButtonEnable(bool i);

private slots:
    void on_postAddButton_clicked();

    void on_postDeleteButton_clicked();

    void on_postUpButton_clicked();

    void on_postDownButton_clicked();

    void on_postTableView_clicked(const QModelIndex &index);

    void on_savePushButton_clicked();

private:
    Ui::CadrePostTab *ui;
    QString currentPerson;
    QSqlRelationalTableModel *postModel;
    QHash<QString,QString> rhash,phash,qulifytypeHash;
    QSqlTableModel* getOriginalModel();
    QString postid;

};

#endif // CADREPOSTTAB_H
